/**
 * Created by Administrator on 2019/6/14.
 */


var app = new Vue({
    el: '#main',
    data: {
        message: '正在请求数据...'
    },
    mounted(){
        axios
            .get('json/vue.json')
            .then(function (response) {
                console.log(response.data.urls);
                app.message = response.data.urls;
                setTimeout(function () {
                    new Swiper('.swiper-container', {
                        loop: true,
                        navigation: {
                            nextEl: '.swiper-button-next',
                            prevEl: '.swiper-button-prev'
                        }
                    });
                }, 100);

            })
            .catch(function (error) {
                console.log(error);
            })
    }
});


var ttt = document.querySelector(".header nav");
var tt = document.querySelector(".header1");


window.onscroll = function () {
    if (document.documentElement.scrollTop > 300 || document.body.scrollTop > 300) {
        ttt.style.display = "none";
        tt.style.display = "block";
    } else {
        ttt.style.display = "block";
        tt.style.display = "none";
    }
};


var slip = document.querySelector("#slip");
var slipDown = document.querySelector("#slipDown");
/*mouseover鼠标划入*/
slip.addEventListener("mouseover", function () {
    slipDown.style.display = "block";
});
slip.addEventListener("mouseleave", function () {
    slipDown.style.display = "none";
});

slipDown.addEventListener("mouseover", function () {
    slipDown.style.display = "block";
});
/*mouseleave鼠标离开除本身*/
slipDown.addEventListener("mouseleave", function () {
    slipDown.style.display = "none";
});


var slide = document.querySelector("#slide");
var slideDown = document.querySelector("#slideDown");
/*mouseover鼠标划入*/
slide.addEventListener("mouseover", function () {
    slideDown.style.display = "block";
});
slide.addEventListener("mouseleave", function () {
    slideDown.style.display = "none";
});
/*mouseleave鼠标离开除本身*/
slideDown.addEventListener("mouseover", function () {
    slideDown.style.display = "block";
});
slideDown.addEventListener("mouseleave", function () {
    slideDown.style.display = "none";
});


var glide = document.querySelector("#glide");
var glideDown = document.querySelector("#glideDown");
/*mouseover鼠标划入*/
glide.addEventListener("mouseover", function () {
    glideDown.style.display = "block";
});
glide.addEventListener("mouseleave", function () {
    glideDown.style.display = "none";
});
/*mouseleave鼠标离开除本身*/
glideDown.addEventListener("mouseleave", function () {
    glideDown.style.display = "none";
});
glideDown.addEventListener("mouseover", function () {
    glideDown.style.display = "block";
});




var pp = document.querySelector("#top");
pp.addEventListener('click',function () {
    window.scrollTo({
        top:0,
        behavior:'smooth'
    })
})


var xs_nav = document.querySelector(".xs-nav .box > img");
xs_nav.addEventListener('click',function () {
    window.scrollTo({
        top:0,
        behavior:'smooth'
    })
})




var s = document.querySelector(".excl");
var rt_o = document.querySelector(".excu");
var excl_i = document.querySelector(".excl i");

s.addEventListener("click",function () {
    if(rt_o.style.height == "213px"){
        rt_o.style.height = "0";
        rt_o.style.opacity = "0";
        excl_i.style.transform = "rotate(0)";
        rt_o.style.display = "none";
    }else{
        rt_o.style.height = "213px";
        rt_o.style.opacity = "1";
        excl_i.style.transform = "rotate(45deg)";
        rt_o.style.display = "block";
    }
});


var ex_one = document.querySelector(".ex-one");
var one_ex = document.querySelector(".one-ex");
var ex_i = document.querySelector(".ex-one > i");

ex_one.addEventListener("click",function () {
    if(one_ex.style.height == "auto"){
        one_ex.style.height = "0";
        one_ex.style.opacity = "0";
        ex_i.style.transform = "rotate(0)";
        one_ex.style.display = "none";
    }else{
        one_ex.style.height = "auto";
        one_ex.style.opacity = "1";
        ex_i.style.transform = "rotate(45deg)";
        one_ex.style.display = "block";
    }
});


var ex_two = document.querySelector(".ex-two");
var two_ex = document.querySelector(".two-ex");
var ex_ii = document.querySelector(".ex-two > i");

ex_two.addEventListener("click",function () {
    if(two_ex.style.height == "auto"){
        two_ex.style.height = "0";
        two_ex.style.opacity = "0";
        ex_ii.style.transform = "rotate(0)";
        two_ex.style.display = "none";
    }else{
        two_ex.style.height = "auto";
        two_ex.style.opacity = "1";
        ex_ii.style.transform = "rotate(45deg)";
        two_ex.style.display = "block";
    }
});


var ex_three = document.querySelector(".ex-three");
var three_ex = document.querySelector(".three-ex");
var three_ii = document.querySelector(".ex-three > i");

ex_three.addEventListener("click",function () {
    if(three_ex.style.height == "auto"){
        three_ex.style.height = "0";
        three_ex.style.opacity = "0";
        three_ii.style.transform = "rotate(0)";
        three_ex.style.display ="none";
    }else{
        three_ex.style.height = "auto";
        three_ex.style.opacity = "1";
        three_ii.style.transform = "rotate(45deg)";
        three_ex.style.display = "block";
    }
});


var ex_four = document.querySelector(".ex-four");
var four_ex = document.querySelector(".four-ex");
var four_ii = document.querySelector(".ex-four > i");

ex_four.addEventListener("click",function () {
    if(four_ex.style.height == "auto"){
        four_ex.style.height = "0";
        four_ex.style.opacity = "0";
        four_ii.style.transform = "rotate(0)";
        four_ex.style.display = "none";
    }else{
        four_ex.style.height = "auto";
        four_ex.style.opacity = "1";
        four_ii.style.transform = "rotate(45deg)";
        four_ex.style.display = "block";
    }
});



